call setpath.bat
set IOTYPE=uart
rem set IOTYPE=keyScreen

rem set HAVE_MATH=
set HAVE_MATH=-DHAVE_MATH=1

set HARD_MATH=
rem set HARD_MATH=-DHARD_MATH=1

if "%IOTYPE%"=="keyScreen" set KEYSCREEN=-DKEYSCREEN=1

set ASM=
"nios2-elf-gcc" -S -Os %KEYSCREEN% fractal.cpp -o fractal.s & set ASM=%ASM%fractal.s
"nios2-elf-gcc" -S -Os inc/system.c -o system.s & set ASM=%ASM%,system.s
"nios2-elf-gcc" -S -Os inc/uart.c -o uart.s & set ASM=%ASM%,uart.s
"nios2-elf-gcc" -S -Os inc/keyScreen.c -o keyScreen.s & set ASM=%ASM%,keyScreen.s
"nios2-elf-gcc" -S -Os %HAVE_MATH% %KEYSCREEN% inc/print.c -o print.s & set ASM=%ASM%,print.s
rem "nios2-elf-gcc" -S -Os inc/Sd2Card.cpp -o Sd2Card.s & set ASM=%ASM%,Sd2Card.s
rem "nios2-elf-gcc" -S -Os inc/ch375b.cpp -o ch375b.s & set ASM=%ASM%,ch375b.s
rem "nios2-elf-gcc" -S -Os inc/FileSystem.cpp -o FileSystem.s & set ASM=%ASM%,FileSystem.s
"nios2-elf-gcc" -S -Os %HARD_MATH% inc/math.c -o math.s & set ASM=%ASM%,math.s
rem "nios2-elf-gcc" -S -Os inc/tjpeg.c -o tjpeg.s & set ASM=%ASM%,tjpeg.s
rem "nios2-elf-gcc" -S -Os inc/windows.cpp -o windows.s & set ASM=%ASM%,windows.s
rem "nios2-elf-gcc" -S -Os inc/dynamicMem.cpp -o dynamicMem.s & set ASM=%ASM%,dynamicMem.s
copy inc\irq.asm irq.s & set ASM=%ASM%,irq.s
compile %ASM% fractal.temp.s dos out.bin 04000000
pause
del %ASM%
